package com.onec.service.api.dto.request.route;

import com.onec.service.api.dto.request.BaseRequest;
import com.onec.service.api.dto.request.gateway.BizContent;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 请求数据：
 * @author onec
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class RouteReq extends BaseRequest {


    /**
     * 业务编号：
     */
    private String businessNo;
    /**
     * 业务编号：
     */
    private String merchantName;

    /**
     * 通道编号
     */
    private String bankCode;
    /**
     * 通道编号
     */
    private String merchantNo;
    /**
     * 通道编号
     */
    private String agentNo;

    /**
     * 通道编号
     */
    private BigDecimal amount;

    /**
     * 卡号
     */
    private String cardNo;
    /**
     * 手机号
     */
    private String phone;
    /**
     * 身份证
     */
    private String idCard;

    /**
     * 交易通到：
     */
    private String service;
    /**
     * 交易通到：
     */
    private String product;


    public RouteReq() {
    }

    /**
     * 交易风控信息
     *
     * @param bizContent
     * @param bankCode
     */
    public RouteReq(BizContent bizContent, String bankCode) {
        this.businessNo = bizContent.getBusinessNo();
        this.bankCode = bankCode;
        this.merchantNo = bizContent.getMerchantNo();
        this.agentNo = bizContent.getAgentNo();
        this.amount = new BigDecimal(bizContent.getAmount());
        this.cardNo = bizContent.getCardNo();
        this.service = bizContent.getService();
        this.product = bizContent.getProduct();
        this.idCard = bizContent.getIdCard();
        this.phone = bizContent.getPhone();
    }

    /**
     * 商户接口信息：
     *
     * @param bizContent
     */
    public RouteReq(BizContent bizContent) {
        this.businessNo = bizContent.getBusinessNo();
        this.merchantNo = bizContent.getMerchantNo();
        this.agentNo = bizContent.getAgentNo();
        this.cardNo = bizContent.getCardNo();
        this.service = bizContent.getService();
        this.product = bizContent.getProduct();
        this.idCard = bizContent.getIdCard();
        this.phone = bizContent.getPhone();
        this.merchantName = bizContent.getMerchantName();
    }


}
